/**
 * Company : SIANGKLOM.
 * Created By : Chatree Siangklom
 * Created On : Oct 15, 2013  2:14:29 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : com.tis.database.services.promis.impl
 * File Name : PaymentVoucherServicesImpl.java
 * TODO
 */
package com.tis.database.services.promis.impl;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.criterion.Criterion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tis.database.dao.promis.PaymentVoucherDao;
import com.tis.database.entitys.promis.GlPostingDetail;
import com.tis.database.entitys.promis.PaymentVoucher;
import com.tis.database.entitys.promis.PaymentVoucherPK;
import com.tis.database.services.promis.IPaymentVoucherServices;

/**
 * @author Chatree Siangklom of Administrator
 * Date =Oct 15, 2013 : 2:14:29 PM 
 * CreateBy=Chatree Siangklom
 * 
 * PaymentVoucherServicesImpl
 * TODO
 */
@Service
@Transactional(readOnly=true)
public class PaymentVoucherServicesImpl implements IPaymentVoucherServices {
	
	private static final Logger logging = LoggerFactory.getLogger(PaymentVoucherServicesImpl.class);

	@Autowired PaymentVoucherDao paymentVoucherDao;
	
	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#findById(com.tis.database.entitys.promis.PaymentVoucherPK)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public PaymentVoucher findById(PaymentVoucherPK id) throws HibernateException, Exception {

		return paymentVoucherDao.findById(id);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#saveOrUpdate(com.tis.database.entitys.promis.PaymentVoucher)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void saveOrUpdate(PaymentVoucher e) throws HibernateException, Exception {

		paymentVoucherDao.saveOrUpdate(e);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#saveOrUpdate(java.util.List)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void saveOrUpdate(List<PaymentVoucher> e) throws HibernateException, Exception {
		
		paymentVoucherDao.saveOrUpdate(e);		
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#findByCriteria(org.hibernate.criterion.Criterion)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public List<PaymentVoucher> findByCriteria(Criterion criterion) throws HibernateException, Exception {

		return paymentVoucherDao.findByCriteria(criterion);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#findByAll(int)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public List<PaymentVoucher> findByAll(int MaxResults) throws HibernateException, Exception {
		
		return paymentVoucherDao.findByAll(MaxResults);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#findHQLByQuery(java.lang.String, java.util.HashMap)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public List<PaymentVoucher> findHQLByQuery(String hql, HashMap<String, String> parameter) throws HibernateException {
		return paymentVoucherDao.findHQLByQuery(hql, parameter);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#SaveOrUpdateHQLByQuery(java.lang.String, java.util.HashMap)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void SaveOrUpdateHQLByQuery(String hql, HashMap<String, String> parameter) throws HibernateException {
		
		paymentVoucherDao.SaveOrUpdateHQLByQuery(hql, parameter);
		
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#findNameQuery(java.lang.String, java.util.HashMap)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public List<PaymentVoucher> findNameQuery(String queryName, HashMap<String, String> parameter) throws HibernateException {

		return paymentVoucherDao.findNameQuery(queryName, parameter);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#SaveOrUpdateQueryName(java.lang.String, java.util.HashMap)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void SaveOrUpdateQueryName(String queryName, HashMap<String, String> parameter) throws HibernateException {
		paymentVoucherDao.SaveOrUpdateQueryName(queryName, parameter);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#NextSequence(java.lang.String)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public BigDecimal NextSequence(String name) throws HibernateException, Exception {

		return paymentVoucherDao.NextSequence(name);
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#NextInstanceNo()
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public BigDecimal NextInstanceNo() throws HibernateException, Exception {
		
		return paymentVoucherDao.NextInstanceNo();
	}

	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#UpdatedBack(com.tis.database.entitys.promis.GlPostingDetail)
	 * Date =Oct 15, 2013 : 2:14:55 PM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	@Transactional(readOnly=false)
	public void UpdateBackSapMessage(GlPostingDetail glPostingDetail) throws HibernateException, Exception {

		paymentVoucherDao.UpdatedBack(glPostingDetail);
	}
	
	/** (Javadoc)
	 * @see com.tis.database.services.promis.IPaymentVoucherServices#FindByIs(java.lang.String, java.lang.String, java.lang.String, int)
	 * Date =Oct 30, 2013 : 11:46:27 AM 
	 * CreateBy=Chatree Siangklom
	 * TODO
	 */
	@Override
	public List<PaymentVoucher> FindByIs(String status, String syncIsstaging, String syncIssync, int maxResult) throws Exception {
		// TODO Auto-generated method stub
		return paymentVoucherDao.FindByIs(status, syncIsstaging, syncIssync, maxResult);
	}
	
	


}
